<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="Cask Data, Inc." name="author" />
<meta content="Copyright © 2014-2017 Cask Data, Inc." name="copyright" />


    <meta name="git_release" content="6.1.1">
    <meta name="git_hash" content="05fbac36f9f7aadeb44f5728cea35136dbc243e5">
    <meta name="git_timestamp" content="2020-02-09 08:22:47 +0800">
    <title>Parser as Log</title>

    <link rel="stylesheet" href="../../_static/cdap-bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/cdap-dynamicscrollspy-4.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/cdap-jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/abixTreeList-2.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/cdap-bootstrap.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '6.1.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/language_data.js"></script>

    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="top" title="Cask Data Application Platform 6.1.1 Documentation" href="../../index.html" />
    <link rel="up" title="CDAP 数据处理指令" href="index.html" />
    <link rel="next" title="Parse as Simple Date" href="parse-as-simple-date.html" />
    <link rel="prev" title="Parse as JSON" href="parse-as-json.html" />
    <!-- block extrahead -->
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- block extrahead end -->

</head>
<body role="document">

<!-- block navbar -->
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
    <div class="container-fluid">
      <div class="row">
        <div class="navbar-header">
          <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
          <a class="navbar-brand" href="../../table-of-contents/../../index.html">
            <span><img alt="CDAP logo" src="../../_static/cdap_logo.svg"/></span>
          </a>

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

          <div class="pull-right">
            <div class="dropdown version-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                role="button" aria-haspopup="true" aria-expanded="false">
                v 6.1.1 <span class="caret"></span>
              </a>
              <ul class="dropdown-menu">
                <li><a href="//docs.cdap.io/cdap/5.1.2/en/index.html">v 5.1.2</a></li>
                <li><a href="//docs.cdap.io/cdap/4.3.4/en/index.html">v 4.3.4</a></li>
              </ul>
            </div>
          </div>
          <form class="navbar-form navbar-right navbar-search" action="../../search.html" method="get">
            <div class="form-group">
              <div class="navbar-search-image material-icons"></div>
              <input type="text" name="q" class="form-control" placeholder="  Search" />
            </div>
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>

          <div class="collapse navbar-collapse nav-collapse navbar-right navbar-navigation">
            <ul class="nav navbar-nav"><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../../table-of-contents/../../index.html">简介</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link current" href="../../table-of-contents/../../guides.html">手册</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../../table-of-contents/../../reference-manual/index.html">参考</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../../table-of-contents/../../faqs/index.html">帮助</a></li>
            </ul>
          </div>

        </div>
      </div>
    </div>
  </div><!-- block navbar end -->
<!-- block main content -->
<div class="main-container container">
  <div class="row"><div class="col-md-2">
      <div id="sidebar" class="bs-sidenav scrollable-y-outside" role="complementary">
<!-- theme_manual: user-guide -->
<!-- theme_manual_highlight: guides -->
<!-- sidebar_title_link: ../../table-of-contents/../../guides.html -->

  <div role="note" aria-label="manuals links"><h3><a href="../../table-of-contents/../../guides.html">Guides</a></h3>

    <ul class="this-page-menu">
      <li class="toctree-l1"><b><a href="../../table-of-contents/../../user-guide/index.html" rel="nofollow">用户手册</a></b>
      <nav class="pagenav">
      <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../index.html"> 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../overview.html"> 概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorials/index.html"> 入门指南</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../tutorials/campaign.html">MySQL 客户数据</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tutorials/nytimes-xml.html">纽约时报 XML 数据推送</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tutorials/stocks.html">股票选择</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../tutorials/fitbit.html">物联网 IoT 设备数据</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html"> 数据预处理</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../concepts.html">      概念</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">      数据处理指令</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="catalog-lookup.html">catalog-lookup</a></li>
<li class="toctree-l3"><a class="reference internal" href="change-column-case.html">change-column-case</a></li>
<li class="toctree-l3"><a class="reference internal" href="changing-case.html">changing-case</a></li>
<li class="toctree-l3"><a class="reference internal" href="cleanse-column-names.html">cleanse-column-names</a></li>
<li class="toctree-l3"><a class="reference internal" href="columns-replace.html">columns-replace</a></li>
<li class="toctree-l3"><a class="reference internal" href="copy.html">copy</a></li>
<li class="toctree-l3"><a class="reference internal" href="cut-character.html">cut-character</a></li>
<li class="toctree-l3"><a class="reference internal" href="decode.html">decode</a></li>
<li class="toctree-l3"><a class="reference internal" href="diff-date.html">diff-date</a></li>
<li class="toctree-l3"><a class="reference internal" href="drop.html">drop</a></li>
<li class="toctree-l3"><a class="reference internal" href="encode.html">encode</a></li>
<li class="toctree-l3"><a class="reference internal" href="extract-regex-groups.html">extract-regex-groups</a></li>
<li class="toctree-l3"><a class="reference internal" href="fail.html">fail</a></li>
<li class="toctree-l3"><a class="reference internal" href="fill-null-or-empty.html">fill-null-or-empty</a></li>
<li class="toctree-l3"><a class="reference internal" href="filter-row-if-matched.html">filter-row-if-matched</a></li>
<li class="toctree-l3"><a class="reference internal" href="filter-row-if-true.html">filter-row-if-true</a></li>
<li class="toctree-l3"><a class="reference internal" href="filter-rows-on.html">filter-rows-on</a></li>
<li class="toctree-l3"><a class="reference internal" href="find-and-replace.html">find-and-replace</a></li>
<li class="toctree-l3"><a class="reference internal" href="flatten.html">flatten</a></li>
<li class="toctree-l3"><a class="reference internal" href="format-date.html">format-date</a></li>
<li class="toctree-l3"><a class="reference internal" href="format-unix-timestamp.html">format-unix-timestamp</a></li>
<li class="toctree-l3"><a class="reference internal" href="generate-uuid.html">generate-uuid</a></li>
<li class="toctree-l3"><a class="reference internal" href="hash.html">hash</a></li>
<li class="toctree-l3"><a class="reference internal" href="increment-variable.html">increment-variable</a></li>
<li class="toctree-l3"><a class="reference internal" href="index-split.html">index-split</a></li>
<li class="toctree-l3"><a class="reference internal" href="invoke-http.html">invoke-http</a></li>
<li class="toctree-l3"><a class="reference internal" href="json-path.html">json-path</a></li>
<li class="toctree-l3"><a class="reference internal" href="keep.html">keep</a></li>
<li class="toctree-l3"><a class="reference internal" href="mask-number.html">mask-number</a></li>
<li class="toctree-l3"><a class="reference internal" href="mask-shuffle.html">mask-shuffle</a></li>
<li class="toctree-l3"><a class="reference internal" href="merge.html">merge</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-avro-file.html">parse-as-avro-file</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-avro.html">parse-as-avro</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-csv.html">parse-as-csv</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-date.html">parse-as-date</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-excel.html">parse-as-excel</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-fixed-length.html">parse-as-fixed-length</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-hl7.html">parse-as-hl7</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-json.html">parse-as-json</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">parse-as-log</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-simple-date.html">parse-as-simple-date</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-as-xml.html">parse-as-xml</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-timestamp.html">parse-timestamp</a></li>
<li class="toctree-l3"><a class="reference internal" href="parse-xml-to-json.html">parse-xml-to-json</a></li>
<li class="toctree-l3"><a class="reference internal" href="quantize.html">quantize</a></li>
<li class="toctree-l3"><a class="reference internal" href="rename.html">rename</a></li>
<li class="toctree-l3"><a class="reference internal" href="send-to-error.html">send-to-error</a></li>
<li class="toctree-l3"><a class="reference internal" href="set-charset.html">set-charset</a></li>
<li class="toctree-l3"><a class="reference internal" href="set-column.html">set-column</a></li>
<li class="toctree-l3"><a class="reference internal" href="set-columns.html">set-columns</a></li>
<li class="toctree-l3"><a class="reference internal" href="set-record-delim.html">set-record-delim</a></li>
<li class="toctree-l3"><a class="reference internal" href="set-type.html">set-type</a></li>
<li class="toctree-l3"><a class="reference internal" href="set-variable.html">set-variable</a></li>
<li class="toctree-l3"><a class="reference internal" href="split-by-separator.html">split-by-separator</a></li>
<li class="toctree-l3"><a class="reference internal" href="split-email.html">split-email</a></li>
<li class="toctree-l3"><a class="reference internal" href="split-to-columns.html">split-to-columns</a></li>
<li class="toctree-l3"><a class="reference internal" href="split-to-rows.html">split-to-rows</a></li>
<li class="toctree-l3"><a class="reference internal" href="split-url.html">split-url</a></li>
<li class="toctree-l3"><a class="reference internal" href="stemming.html">stemming</a></li>
<li class="toctree-l3"><a class="reference internal" href="swap.html">swap</a></li>
<li class="toctree-l3"><a class="reference internal" href="table-lookup.html">table-lookup</a></li>
<li class="toctree-l3"><a class="reference internal" href="text-distance.html">text-distance</a></li>
<li class="toctree-l3"><a class="reference internal" href="text-metric.html">text-metric</a></li>
<li class="toctree-l3"><a class="reference internal" href="trim.html">trim</a></li>
<li class="toctree-l3"><a class="reference internal" href="url-decode.html">url-decode</a></li>
<li class="toctree-l3"><a class="reference internal" href="url-encode.html">url-encode</a></li>
<li class="toctree-l3"><a class="reference internal" href="write-as-csv.html">write-as-csv</a></li>
<li class="toctree-l3"><a class="reference internal" href="write-as-json-map.html">write-as-json-map</a></li>
<li class="toctree-l3"><a class="reference internal" href="write-as-json-object.html">write-as-json-object</a></li>
<li class="toctree-l3"><a class="reference internal" href="xpath.html">xpath</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../functions/index.html">      函数</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../functions/json-functions.html">JSON 函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../functions/type-functions.html">类型函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../functions/geofence-functions.html">地理围栏函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../functions/dq-functions.html">数据质量函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../functions/date-functions.html">日期函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../functions/ddl-functions.html">DDL 函数</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../service/index.html">      服务</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../service/admin.html">行政和管理服务</a></li>
<li class="toctree-l3"><a class="reference internal" href="../service/connection-properties.html">连接属性</a></li>
<li class="toctree-l3"><a class="reference internal" href="../service/connections.html">连接服务</a></li>
<li class="toctree-l3"><a class="reference internal" href="../service/execution.html">数据处理指令执行</a></li>
<li class="toctree-l3"><a class="reference internal" href="../service/request.html">请求格式规范</a></li>
<li class="toctree-l3"><a class="reference internal" href="../service/schema-registry.html">Schema 注册库</a></li>
<li class="toctree-l3"><a class="reference internal" href="../service/services.html">数据预处理服务</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../performance.html">性能</a></li>
<li class="toctree-l2"><a class="reference internal" href="../exclusion-and-aliasing.html">排除与别名</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../pipelines/index.html"> 数据流管道</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/concepts-design.html"> 概念与设计</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/getting-started.html"> 入门指南</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/studio.html"> CDAP 数据流设计器</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/creating-pipelines.html"> 创建数据流管道</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/running-pipelines.html"> 运行数据流管道</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/plugin-management.html"> 插件管理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/plugins/index.html"> 插件参考</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/actions/index.html"> Action Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/sources/index.html"> Source Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/transforms/index.html"> Transform Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/analytics/index.html"> Analytic Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/sinks/index.html"> Sink Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/shared-plugins/index.html"> Shared Plugins</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../pipelines/plugins/shared-plugins/core.html">CoreValidator</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/post-run-plugins/index.html"> Post-run Plugins</a><ul class="simple">
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../mmds/index.html"> 数据分析</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../mmds/concepts.html"> Concepts</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../mmds/feature-gen.html"> Feature Generation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../mmds/modeling.html"> Modeling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../mmds/example.html"> Example</a></li>
</ul>
</li>
</ul>
</nav>
      </li>
      <li class="toctree-l1"><a href="../../table-of-contents/../../developer-manual/index.html" rel="nofollow">开发手册</a>
      </li>
      <li class="toctree-l1"><a href="../../table-of-contents/../../admin-manual/index.html" rel="nofollow">管理手册</a>
      </li>
      <li class="toctree-l1"><a href="../../table-of-contents/../../integrations/index.html" rel="nofollow">集成手册</a>
      </li>
      <li class="toctree-l1"><a href="../../table-of-contents/../../examples-manual/index.html" rel="nofollow">最佳实践</a>
      </li>
    </ul>
  </div></div>
    </div><div class="col-md-8 content" id="main-content">
    
  <div class="section" id="parser-as-log">
<h1>Parser as Log<a class="headerlink" href="#parser-as-log" title="Permalink to this headline">🔗</a></h1>
<p>The PARSE-AS-LOG directive parses access log files, such as from Apache
HTTPD and nginx servers.</p>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">🔗</a></h2>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="n">parse</span><span class="o">-</span><span class="n">as</span><span class="o">-</span><span class="n">log</span> <span class="o">&lt;</span><span class="n">column</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">format</span><span class="o">&gt;</span>
</pre></div>
</div>
</div>
<div class="section" id="usage-notes">
<h2>Usage Notes<a class="headerlink" href="#usage-notes" title="Permalink to this headline">🔗</a></h2>
<p>The PARSE-AS-LOG directive provides a generic log parser that you
construct by specifying the <code class="docutils literal notranslate"><span class="pre">&lt;format&gt;</span></code> of the log line or the format
in which the file was written. The format, which specifies the
configuration options of the log line, becomes the schema of the access
log lines as written by the service.</p>
<p>In addition to the config options specified in the Apache HTTPD manual
under <a class="reference external" href="http://httpd.apache.org/docs/current/mod/mod_log_config.html#formats">Custom Log
Formats</a>,
these options are recognized:</p>
<ul class="simple">
<li>common</li>
<li>combined</li>
<li>combinedio</li>
<li>referer</li>
<li>agent</li>
</ul>
<p>For example: to parse either <em>combined log format</em> or <em>common log
format</em>, you can use:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="n">parse</span><span class="o">-</span><span class="n">as</span><span class="o">-</span><span class="n">log</span> <span class="n">body</span> <span class="n">combined</span>
<span class="n">parse</span><span class="o">-</span><span class="n">as</span><span class="o">-</span><span class="n">log</span> <span class="n">body</span> <span class="n">common</span>
</pre></div>
</div>
<p>If you have logs that are in a format that is not supported, you can
specify a custom format. In that case, <code class="docutils literal notranslate"><span class="pre">format</span></code> is a string of tokens
specifying the log line format.</p>
<p>For nginx, the <code class="docutils literal notranslate"><span class="pre">format</span></code> tokens are specified by
<a class="reference external" href="http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format">log_format</a>
and <a class="reference external" href="http://nginx.org/en/docs/http/ngx_http_core_module.html#variables">embedded
variables</a>.</p>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">🔗</a></h2>
<p>The format for common log is:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="o">%</span><span class="n">h</span> <span class="o">%</span><span class="n">l</span> <span class="o">%</span><span class="n">u</span> <span class="o">%</span><span class="n">t</span> <span class="s">&quot;%r&quot;</span> <span class="o">%&gt;</span><span class="n">s</span> <span class="o">%</span><span class="n">b</span>
</pre></div>
</div>
<p>and a corresponding log line as a record that needs to be parsed, in
that format:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s">&quot;body&quot;</span><span class="p">:</span> <span class="s">&quot;127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] \&quot;GET /apache_pb.gif HTTP/1.0\&quot; 200 2326&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Applying either of these directives:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="n">parse</span><span class="o">-</span><span class="n">as</span><span class="o">-</span><span class="n">log</span> <span class="n">body</span> <span class="o">%</span><span class="n">h</span> <span class="o">%</span><span class="n">l</span> <span class="o">%</span><span class="n">u</span> <span class="o">%</span><span class="n">t</span> <span class="s">&quot;%r&quot;</span> <span class="o">%&gt;</span><span class="n">s</span> <span class="o">%</span><span class="n">b</span>
<span class="n">parse</span><span class="o">-</span><span class="n">as</span><span class="o">-</span><span class="n">log</span> <span class="n">body</span> <span class="n">common</span>
</pre></div>
</div>
<p>would result in this record:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s">&quot;ip_connection_client_host&quot;</span><span class="p">:</span> <span class="s">&quot;127.0.0.1&quot;</span><span class="p">,</span>
  <span class="s">&quot;ip_connection_client_host.last&quot;</span><span class="p">:</span> <span class="s">&quot;127.0.0.1&quot;</span>
  <span class="s">&quot;number_connection_client_logname&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  <span class="s">&quot;number_connection_client_logname.last&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  <span class="p">...</span>
  <span class="p">...</span>
  <span class="s">&quot;http_path_request_firstline_uri_path&quot;</span><span class="p">:</span> <span class="s">&quot;/apache_pb.gif&quot;</span><span class="p">,</span>
  <span class="s">&quot;http_ref_request_firstline_uri_ref&quot;</span><span class="p">:</span> <span class="kc">null</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Using the Combined Log Format:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span>%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-agent}i\
</pre></div>
</div>
<p>and a corresponding log line:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="mf">127.0.0.1</span> <span class="o">-</span> <span class="n">frank</span> <span class="o">[</span><span class="mi">10</span><span class="o">/</span><span class="n">Oct</span><span class="o">/</span><span class="mi">2000</span><span class="p">:</span><span class="mi">13</span><span class="p">:</span><span class="mi">55</span><span class="p">:</span><span class="mi">36</span> <span class="o">-</span><span class="mo">0700</span><span class="o">]</span> <span class="s">&quot;GET /apache_pb.gif HTTP/1.0&quot;</span> <span class="mi">200</span> <span class="mi">2326</span> <span class="s">&quot;http://www.example.com/start.</span>
<span class="s">html&quot;</span> <span class="s">&quot;Mozilla/4.08 [en] (Win98; I ;Nav)&quot;</span>
</pre></div>
</div>
<p>Complex formats, such as this, can also be parsed:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span>%t %u [%D %h %{True-Client-IP}i %{UNIQUE_ID}e %r] %{Cookie}i %s \&quot;%{User-Agent}i\&quot; \&quot;%{host}i\&quot; %l %b %{Referer}i
</pre></div>
</div>
<p>Example log line for such a format (note: reformatted from a single
line):</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span>[03/Dec/2013:10:53:59 +0000] - [32002 10.102.4.254 195.229.241.182 Up24RwpmBAwAAA1LWJsAAAAR GET
/content/dam/Central_Library/Street_Shots/Youth/2012/09sep/LFW/Gallery_03/LFW_SS13_SEPT_12_777.jpg.
image.W0N539E3452S3991w313.original.jpg HTTP/1.1] __utmc=94539802; dtCookie=EFD9D09B6A2E1789F1329FC1
381A356A|_default|1; dtPC=471217988_141#_load_; Carte::KerberosLexicon_getdomain=6701c1320dd96688b2e
40b92ce748eee7ae99722; UserData=Username%3ALSHARMA%3AHomepage%3A1%3AReReg%3A0%3ATrialist%3A0%3ALangua
ge%3Aen%3ACcode%3Aae%3AForceReReg%3A0; UserID=1375493%3A12345%3A1234567890%3A123%3Accode%3Aae; USER_D
ATA=1375493%3ALSharma%3ALokesh%3ASharma%3Alokesh.sharma%40landmarkgroup.com%3A0%3A1%3Aen%3Aae%3A%3Ado
main%3A1386060868.51392%3A6701c1320dd96688b2e40b92ce748eee7ae99722; MODE=FONTIS; __utma=94539802.9110
97326.1339390457.1386060848.1386065609.190; __utmz=94539802.1384758205.177.38.utmcsr=google|utmccn=(o
rganic)|utmcmd=organic|utmctr=(not%20provided); __kti=1339390460526,http%3A%2F%2Fwww.domain.com%2F,;
__ktv=28e8-6c4-be3-ce54137d9e48271; WT_FPC=id=2.50.27.157-3067016480.30226245:lv=1386047044279:ss=138
6046439530; _opt_vi_3FNG8DZU=42880957-D2F1-4DC5-AF16-FEF88891D24E; __hstc=145721067.750d315a49c642681
92826b3911a4e5a.1351772962050.1381151113005.1381297633204.66; hsfirstvisit=http%3A%2F%2Fwww.domain.co
m%2F|http%3A%2F%2Fwww.google.co.in%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3Ddomain.com%26source%3Dweb%26cd%3D1%
26ved%3D0CB0QFjAA%26url%3Dhttp%3A%2F%2Fwww.domain.com%2F%26ei%3DDmuSULW3AcTLhAfJ24CoDA%26usg%3DAFQjCN
GvPmmyn8Bk67OUv-HwjVU4Ff3q1w|1351772962000; hubspotutk=750d315a49c64268192826b3911a4e5a; __ptca=14572
1067.jQ7lN5U3C4eN.1351758562.1381136713.1381283233.66; __ptv_62vY4e=jQ7lN5U3C4eN; __pti_62vY4e=jQ7lN5
U3C4eN; __ptcz=145721067.1351758562.1.0.ptmcsr=google|ptmcmd=organic|ptmccn=(organic)|ptmctr=domain.
com; RM=Lsharma%3Ac163b6097f90d2869e537f95900e1c464daa8fb9; wcid=Up2cRApmBAwAAFOiVhcAAAAH%3Af32e5e5f5
b593175bfc71af082ab26e4055efeb6; __utmb=94539802.71.9.1386067462709; edge_auth=ip%3D195.229.241.182~
expires%3D1386069280~access%3D%2Fapps%2F%2A%21%2Fbin%2F%2A%21%2Fcontent%2F%2A%21%2Fetc%2F%2A%21%2Fho
me%2F%2A%21%2Flibs%2F%2A%21%2Freport%2F%2A%21%2Fsection%2F%2A%21%2Fdomain%2F%2A~md5%3D5b47f341723924
87dcd44c1d837e2e54; has_js=1; SECTION=%2Fcontent%2Fsection%2Finspiration-design%2Fstreet-shots.html;
JSESSIONID=b9377099-7708-45ae-b6e7-c575ffe82187; WT_FPC=id=2.50.27.157-3067016480.30226245:lv=138605
3618209:ss=1386053618209; USER_GROUP=LSharma%3Afalse; NSC_wtfswfs_xfcgbsn40-41=ffffffff096e1a1d45525
d5f4f58455e445a4a423660 200 &quot;Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)&quot;
&quot;www.domain.com&quot; - 24516 http://www.domain.com/content/report/Street_Shots/Youth/Global_round_up/201
3/01_Jan/mens_youth_stylingglobalround-up1.html
</pre></div>
</div>
</div>
</div>

</div>
    <div class="col-md-2">
      <div id="right-sidebar" class="bs-sidenav scrollable-y" role="complementary">
        <div id="localtoc-scrollspy">
        </div>
      </div>
    </div></div>
</div>
<!-- block main content end -->
<!-- block footer -->
<footer class="footer">
      <div class="container">
        <div class="row">
          <div class="col-md-2 footer-left"><a title="Parse as JSON" href="parse-as-json.html" />Previous</a></div>
          <div class="col-md-8 footer-center"><a class="footer-tab-link" href="../../table-of-contents/../../reference-manual/licenses/index.html">Copyright</a> &copy; 2014-2020 Cask Data, Inc.&bull; <a class="footer-tab-link" href="//docs.cask.co/cdap/6.1.1/cdap-docs-6.1.1-web.zip" rel="nofollow">Download</a> an archive or
<a class="footer-tab-link" href="//docs.cask.co/cdap">switch the version</a> of the documentation
          </div>
          <div class="col-md-2 footer-right"><a title="Parse as Simple Date" href="parse-as-simple-date.html" />Next</a></div>
        </div>
      </div>
    </footer>
<!-- block footer end -->
<script type="text/javascript" src="../../_static/bootstrap-3.3.6/js/bootstrap.min.js"></script><script type="text/javascript" src="../../_static/js/bootstrap-sphinx.js"></script><script type="text/javascript" src="../../_static/js/abixTreeList-2.js"></script><script type="text/javascript" src="../../_static/js/cdap-dynamicscrollspy-4.js"></script><script type="text/javascript" src="../../_static/js/cdap-version-menu.js"></script><script type="text/javascript" src="../../_static/js/copy-to-clipboard.js"></script><script type="text/javascript" src="../../_static/js/jquery.mousewheel.min.js"></script><script type="text/javascript" src="../../_static/js/jquery.mCustomScrollbar.js"></script><script type="text/javascript" src="../../_static/js/js.cookie.js"></script><script type="text/javascript" src="../../_static/js/tabbed-parsed-literal-0.2.js"></script><script type="text/javascript" src="../../_static/js/cdap-onload-javascript.js"></script><script type="text/javascript" src="../../_static/js/cdap-version-menu.js"></script>
    <script src="https://cdap.gitee.io/docs/cdap/json-versions.js"/></script>
  </body>
</html>